<?php 
class Testuser_model extends DataMapper {

	var $has_one = array("state");

    function __construct($id = NULL)
    {
        parent::__construct($id);
    }
	
    function getStates()
    {
    	$query = $this->db->query("select * from state");

		if($query->num_rows()>0)
		{
		// return result set as an associative array
		$hmm = $query->result_array();
		$what[0] = "";
			foreach ($hmm as $key=>$value)
			{
				$what[$value['name_short']] = $value['name_long'];
			}
		}
		return $what;    	
    }
}